package com.threadPool;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author yijy
 * @description
 * @create 2021/3/28 下午5:08
 **/
public class ThreadPoolTest {

    public static void main(String[] args) {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(4,4,10,
                TimeUnit.MINUTES,new ArrayBlockingQueue<>(1024));
        ThreadPoolExecutor threadPoolExecutor1 = new ThreadPoolExecutor(4,4,10,
                TimeUnit.MINUTES,new LinkedBlockingQueue<>(1024));
        threadPoolExecutor.execute(()->{
            System.out.println("hello world!");
        });
        Runnable runnable = ()->{
            System.out.print("media");
        };
        Thread thread3 = new Thread(runnable);
        thread3.run();
        System.out.println("focus");
    }
}
